/**
 * 
 */
package edu.umd.clip.lm.model.data;

import java.util.Observable;
import java.util.Observer;

/**
 * @author Denis Filimonov <den@cs.umd.edu>
 *
 */
public class WritableTrainingDataNode extends AbstractTrainingDataNode {
	private WritableTrainingData[] data;
	
	public WritableTrainingDataNode(int nodeId, WritableTrainingData[] data) {
		super(nodeId, data.length);
		setData(data);
	}

	public WritableTrainingData[] getData() {
		return data;
	}

	public WritableTrainingData getData(int num) {
		return data[num];
	}

	public void setData(WritableTrainingData[] data) {
		this.data = data;
	}

	public void setData(int num, WritableTrainingData data) {
		this.data[num] = data;
	}
	
	public int getNum(WritableTrainingData data) {
		for(int i=0; i<this.data.length; ++i) {
			if (this.data[i] == data) return i;
		}
		return -1;
	}
}
